{php $huodongbaoming = \Phpcmf\Service::M()->db->table('1_quan_form_hdbm')->where('tid', $t.id)->where('cid', $quanzhuid['id'])->where('uid', $member.uid)->get()->getRowArray();}
<div class="d-kuan d-shangxia-10 d-beijing-fenghong-1 d-yuanjiao-10" >
	<div class="d-neikuang-20" >
		<div class="d-kuan d-jiacu d-wenzi-16 d-zitiyanse-hongse">
			报名活动
			<span class="pull-right">
				@{if $t.hdfw==0}所有人{else}本圈{/if}
			</span>
		</div>
		<div class="d-kuan d-wenzi-juzhong d-a-baise d-quxian-0">
			<div class="d-wenzi-20 d-zitiyanse-hongse" id="countdown_{$t.id}"></div>
			<div class="d-wenzi-16 ">
				<span class="d-wenzi-12">结束：{$t.hdjs}</span>
			</div>
			<div class="d-wenzi-16 ">
				<span class="d-wenzi-12">开始：{$t.hdks}</span>
			</div>
			<div class="d-clear d-shang-20"></div>
			
			{if $t.hdfw==0}
			    {if strtotime($t.hdjs) < time()}
				    <a class="d-waikuang-10 d-neikuang-30-30 d-beijing-fenhong" >
				    	活动已圆满结束
				    </a>
				{else}
					{if $huodongbaoming}
					    <a class="d-waikuang-10 d-neikuang-30-30 d-beijing-fenhong">
					    	您已经报名
					    </a>
					{else}
						{if $t.hdwxh==2 || $t.hdsjh==2 || $t.sctp==2 || $t.scfj==2}
							<!-- a class="d-waikuang-10 d-neikuang-30-30 d-beijing-fenhong" onclick="javascript:d_huodong_baoming();"-->
							<a class="d-waikuang-10 d-neikuang-30-30 d-beijing-fenhong" href="{dr_son_url($t)}">
								立即报名
							</a>
						{else}
						
							<a class="d-waikuang-10 d-neikuang-30-30 d-beijing-fenhong" href="{dr_son_url($t)}">
								立即报名
							</a>
						{/if}
					{/if}
				{/if}
			{else}
			    {if strtotime($t.hdjs) < time()}
					<a class="d-waikuang-10 d-neikuang-30-30 d-beijing-fenhong" >
						活动已圆满结束
					</a>
				{else}
					{php $huodonghuiyuan = \Phpcmf\Service::M()->db->table('1_quan_cart')->where('cid', $id)->where('uid', $member.uid)->get()->getRowArray();}
					{if $huodonghuiyuan || $t.uid == $member.uid || $uid == $member.uid}
						{if $huodongbaoming}
						    <a class="d-waikuang-10 d-neikuang-30-30 d-beijing-fenhong">
						    	您已经报名
						    </a>
						{else}
							{if $t.hdwxh==2 || $t.hdsjh==2 || $t.sctp==2 || $t.scfj==2}
								
								<a class="d-waikuang-10 d-neikuang-30-30 d-beijing-fenhong" href="{dr_son_url($t)}">
									立即报名
								</a>
							{else}
							
								<a class="d-waikuang-10 d-neikuang-30-30 d-beijing-fenhong" href="{dr_son_url($t)}">
									立即报名
								</a>
							{/if}
						{/if}
					{else}
					
						<a class="d-waikuang-10 d-neikuang-30-30 d-beijing-fenhong tag_joins_huodong" data-id="{$id}" id="tag_joins_{$index['id']}">
							加入圈子后报名
						</a>
					{/if}
				{/if}
			{/if}
			
			{php $shengyuminge = $t.hdrs - $t.huodongshuliang;}
			{if $shengyuminge == 0}
			<div class="d-wenzi-14 d-shang-20">
				<span class="d-jiacu">
				    人数已满
				</span>
			</div>
			{else}
			<div class="d-wenzi-14 d-shang-20">
				还剩余 <span class="d-jiacu">
				    {$shengyuminge}
				</span> 个名额
			</div>
			{/if}
			
			<div class="d-wenzi-14 ">
				
				{if $t.hdfs==1}
					线下免费活动
				{elseif $t.hdfs==2}
					线下付费活动, 每人支付 {$t.hdfy} 元
				{elseif $t.hdfs==3}
					线上免费活动
				{elseif $t.hdfs==4}
					线上付费活动, 每人支付 {$t.hdfy} 元
				{elseif $t.hdfs==5}
					线上{SITE_SCORE}活动,每人消耗 {$t.huodongjifen} {SITE_SCORE}
				{/if}
			</div>
			
			{if $t.huodongshuliang > 0}
			<div class="d-yuanjiao-20 d-kuan d-buhuanhang d-shang-10 d-a-hei">
				{php $biaomod = '1_quan_form_hdbm';}
				{table table=$biaomod baominghedui=1 tid=$t.id num=15 return=t2}
					<a href="/index.php?s=huiyuan&c=show&m=index&uid={$t2.uid}">
						<img src="{dr_avatar($t2.uid)}" width="25" height="25" class="d-touxiang-10"/>
					</a>
				{/table}
				
			</div>
			{/if}
			<div class="d-wenzi-zuo d-shang-5 d-wenzi-12 d-a-hei" style="color: #2b2b2b;" >已报名 {$t.huodongshuliang} 位</div>
		</div>
	</div>
</div>


<style>
	.d-beijing-fenghong-1 {
		background-color: #fff6f6;
	}
	.d-a-baise a {
		border-radius: 10px;
		color: #ffffff;
	}
	.d-a-baise a:hover {
		
		border-radius: 10px;
		color: #ffffff;
	}
	
</style>

<script type="text/javascript">
//倒计时
function d_daojishi_{$t.id}(){
	$(document).ready(function() {
			// 设置倒计时的结束时间
			var countDownDate = new Date("{$t.hdjs}").getTime();
			// 每隔1秒钟更新倒计时
			var countdownInterval = setInterval(function() {
			// 获取当前时间
			var now = new Date().getTime();
			// 计算时间差
			var distance = countDownDate - now;
			// 计算倒计时的天、小时、分钟和秒
			var days = Math.floor(distance / (1000 * 60 * 60 * 24));
			var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
			var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
			var seconds = Math.floor((distance % (1000 * 60)) / 1000);

			// 在页面上更新倒计时
			$("#countdown_{$t.id}").html(days + " 天 " + hours + " 小时 " + minutes + " 分钟 " + seconds + " 秒 "+" 结束 ");

			// 如果倒计时结束，清除定时器
			if (distance < 0) {
				clearInterval(countdownInterval);
				$("#countdown_{$t.id}").html("");
			}
		}, 500);
	});
}
d_daojishi_{$t.id}();
//每一秒执行一次
</script>